<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #template {
        display: none;
      }
    </style>
  </head>
  <body>
    <!-- 1. key placement error -->
    <!-- <template v-for="item in obj">
        <div :key="item"></div>
      </template> -->

    <!-- <div v-for="(item, key, i) in obj" key="xx"></div> -->

    <!-- <div v-for="item in 6"></div> -->

    <!-- <p v-for="item in obj">{{item}}</p> -->

    <!-- <p v-for="(item, key, index) in obj">{{item}}</p> -->

    <!-- <template v-for="(item, key, i) in obj" :key="key">
      <h1>1</h1>
      <h1>2</h1>
    </template> -->

    <!-- <div v-for="item in obj" v-memo="[count]"></div> -->
    <!-- <template v-for="item in obj" :key="key">
      <slot name="xxx"></slot>
    </template> -->

    <!-- <template v-for="item in items" :key="item.id"><span :id="item.id" /></template> -->

    <!-- <div v-for="(item, key, i) in obj" v-memo="[xx]" key="xx"> -->

    <!-- <div v-for="(item, key, i) in obj" v-memo="[value]" key="xx" @click="push">
        {{item}}
        {{key}}
        {{i}}
      </div> -->
    <div id="template">
      <div
        v-for="(item, key, i) in obj"
        v-if="value"
        key="xx"
        @click="push"
      >
        {{item}} {{key}} {{i}}
      </div>
    </div>
    <div id="app"></div>
    <script src="../../../../packages/vue/dist/vue.global.js"></script>

    <script>
      const { createApp, ref } = Vue

      const template = document.querySelector('#template')?.innerHTML
      const App = {
        setup() {
          const value = ref(NaN)
          const obj = ref([1])
          const add = () => value.value++
          const push = () => {
            obj.value = [...obj.value, obj.value[obj.value.length - 1] + 1]
          }
          return {
            value,
            obj,
            add,
            push
          }
        },
        template
      }

      createApp(App).mount('#app')
    </script>
  </body>
</html>
